Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow Adding User Over Limit From Console In Team Membership #8122

Conversation

ketanbaitule
Copy link
Contributor

What does this PR do?

It allows Adding user over limit from console in team membership.

Fixes #5516

Test Plan

Manual

Screencast.from.2024-05-15.15-14-29.mp4

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@stnguyen90 stnguyen90 self-requested a review May 15, 2024 16:43
app/controllers/api/teams.php Outdated Show resolved Hide resolved
@ketanbaitule ketanbaitule force-pushed the fix-5516-in-team-membership-allow-adding-user-over-limit-from-console-or-apikey branch from 5d60a77 to 6ff3fc5 Compare May 15, 2024 17:57
app/controllers/api/teams.php Outdated Show resolved Hide resolved
Co-authored-by: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com>
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please also add test cases. The best place is probably here:

$response = $this->client->call(Client::METHOD_POST, '/account', array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $id,
]), [
'userId' => ID::unique(),
'email' => $email,
'password' => $password,
'name' => $name,
]);
$this->assertEquals($response['headers']['status-code'], 501);

2 API calls should be called using the Console account (include the headers like here):

  1. POST /users
  2. POST /teams/id/memberships (you'll need to create the team first too)

@stnguyen90 stnguyen90 merged commit 13b275a into appwrite:main May 20, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: with Users limited to 1, creating team membership in console gives restricted error
2 participants